
//new method
function showOtherMsg(){
	var allMsg = document.getElementById("allMsg").value;
	var url="/webMessage/ajaxmsg/"+allMsg;
	var myAjax = new Ajax.Request(url,{
						            method: 'post',
						            onComplete: function (response) {
						            	new Insertion.Before('tablemsg', response.responseText);
						            }
        });
	var hrf = document.getElementById("hrf");
	hrf.style.display="none";
}
function showDetail(id) {
	var url="/webMessage/showmsg/"+id;
	Dialog.confirm({url:url,method:'get'},{
				 className: "alphacube",
				 width:580,
//				 id: "d" + id, 
//				 okLabel: "閉じる",
				 buttonClass:"eldisplay",
				 closable:true
				})
}

function getIdAndFlg() {
	var p = new Array();
	var idAndFlgInfo = document.getElementById("idAndFlgInfo");
	idAndFlgInfo.value = '';
	var c = document.getElementsByTagName("input")
	for (i = 0; i < c.length; i++) {
		if (c[i].type == "checkbox" && c[i].checked) {
			p.push(c[i].value);
		}
	}
	for(j=0;j<p.length;j++) {
		if (j==0) {
			idAndFlgInfo.value = p[j];
		} else {
			idAndFlgInfo.value += ";"+p[j];
		}
	}
	return p.length;
}

/*function getReplyId() {
	var p = new Array();
	var idAndFlgInfo = document.getElementById("replyId");
	var c = document.getElementsByTagName("input")
	for (i = 0; i < c.length; i++) {
		if (c[i].type == "checkbox" && c[i].checked) {
			p.push(c[i].value);
		}
	}
	if (p.length == 0) {
		alert('レコードを1件以上選択してください。');
		return false;
	} else {
		for(j=0;j<p.length;j++) {
			if (j==0) {
				idAndFlgInfo.value = p[j];
			} else {
				idAndFlgInfo.value += ";"+p[j];
			}
		}
		return true;
	}
}
function replyForm(frmName, frmAction, str) {
	var yesno = window.confirm(str);
	if (yesno) {
		if(getReplyId()){
			frm = document.getElementById(frmName);
			frm.action = frmAction;
			frm.submit();
		}else {
			return;
		}
	}
}*/

function msgDetail(frmName, frmAction,str) {
	frm = document.getElementById(frmName);
	var msgParams = document.getElementById("msgParams");
	msgParams.value = str;
	frm.action = frmAction;
	frm.submit();
}
function txtAreaAble() {
	var status3 = document.getElementById("status3");
	var txtArea = document.getElementById("txtArea");
	if (status3.checked) {
		txtArea.disabled=false;
	} else {
		txtArea.value='';
		txtArea.disabled=true;
	}
}
function titleContentAble() {
	var status3 = document.getElementById("status3");
	var status2 = document.getElementById("status2");
	var status4 = document.getElementById("status4");
	var txtArea = document.getElementById("txtArea");
	var subject = document.getElementById("resubject");
//	var hidsubject = document.getElementById("hidsubject");
//	var title = document.getElementById("filePart");
	if (status3.checked) {
//		txtArea.disabled=false;
//		subject.disabled=false;
		txtArea.value='';
		subject.value='[スカウト]求職者から質問が届いています';
		//hidsubject.value="[スカウト]求職者から質問が届いています";
//		subject.value='';
	} else {
		if (status2.checked) {
			subject.value='[スカウト]興味あり';
			//hidsubject.value="[スカウト]興味あり";
		}
		if (status4.checked) {
			subject.value='[スカウト]辞退する';
			//hidsubject.value="[スカウト]辞退する";
		}
//		txtArea.disabled=true;
//		subject.disabled=true;
	}
}


function checkForm(frmName, frmAction, str) {
	var len = getIdAndFlg();
	if (len > 0) {
		var yesno = window.confirm(str);
		if (yesno) {
			frm = document.getElementById(frmName);
			frm.action = frmAction;
			frm.submit();
		}
	} else {
		alert('レコードを1件以上選択してください。');
		return;
	}

}

